//
// Created by Administrator on 2023/8/2.
//

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>

using namespace std;


class Solution {
public:
    vector<vector<int>> sortTheStudents(vector<vector<int>> &score, int k) {
        // 对score排序，根据第k列的大小
        sort(score.begin(), score.end(), [&](const vector<int> &a, const vector<int> &b) {
            return a[k] > b[k];
        });
        return score;
    }
};


int main() {
    vector<vector<int>> score = {{10, 6, 9,  1},
                                 {7,  5, 11, 2},
                                 {4,  8, 3,  15}};
    int k = 2;
    Solution solution = Solution();
    vector<vector<int>> result = solution.sortTheStudents(score, k);
    for (auto &i: result) {
        for (int j = 0; j < i.size(); j++) {
            cout << i[j] << " ";
        }
        cout << endl;
    }
    return 0;
}